<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>



</body>
<script>

  // 学习目标：class 等于构造函数
  class Person {
    name = 'zs';
    gender = '男'
    static age = 19
    static sayHi() {
      console.log('哈哈')
    }

    goodBye() {
      console.log('byebye')
    }
  }

  console.log('Person.gender  ----->  ', Person.gender);

  // 静态属性和静态方法  -  静态成员，只能通过构造函数或者类的名字去访问
  Person.age = 18
  Person.sayHi = function sayHi() {
    console.log('哈哈')
  }
  // 实例属性实例方法 - 实例成员，只能通过实例对象去访问
  const zs = new Person()
  console.log('zs  ----->  ', zs);

</script>

</html>